﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="JYHDAdd.aspx.cs"
    Inherits="Manager_ArticlesAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>新增新闻信息</title>
    <link rel="stylesheet" href="../ueditor/themes/default/ueditor.css" />
    <style type="text/css">
        .mright
        {
            margin-right: 5px;
        }
        .datecontainer .x-form-field-trigger-wrap
        {
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" runat="server" AjaxLoadingType="mask" AutoSizePanelID="sfObject" />
    <ext:SimpleForm ID="sfObject" runat="server" ShowHeader="false" LabelAlign="left"
        BodyPadding="10px" LabelWidth="95px" AutoScroll="true" FooterBarAlign="center">
        <Items>
            <ext:Panel ID="Panel1" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer">
                <Items>
                    <ext:HiddenField ID="hfArticleId" runat="server">
                    </ext:HiddenField>
                    <ext:Label ID="Label1" Width="100px" runat="server" Text="活动名称：">
                    </ext:Label>
                    <ext:TextBox ID="txtTitle" runat="server" Required="true" Width="480px" Label="活动名称"
                        EmptyText="请填写活动名称">
                    </ext:TextBox>
                </Items>
            </ext:Panel>
            <ext:Panel ID="Panel4" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer">
                <Items>
                    <ext:HiddenField ID="HiddenField1" runat="server">
                    </ext:HiddenField>
                    <ext:Label ID="Label8" Width="100px" runat="server" Text="活动组织：">
                    </ext:Label>
                    <ext:TextBox ID="txtaAllClassIds" runat="server" Required="true" Width="480px" Label="活动组织"
                        EmptyText="请填写活动组织">
                    </ext:TextBox>
                </Items>
            </ext:Panel>
            <ext:Panel ID="Panel5" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer">
                <Items>
                    <ext:HiddenField ID="HiddenField2" runat="server">
                    </ext:HiddenField>
                    <ext:Label ID="Label9" Width="100px" runat="server" Text="活动时间：">
                    </ext:Label>
                    <ext:DatePicker ID="dpAddTime" runat="server" Label="活动时间" EmptyText="请选择活动时间">
                    </ext:DatePicker>
                </Items>
            </ext:Panel>
            <ext:Panel ID="Panel6" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer">
                <Items>
                    <ext:HiddenField ID="HiddenField3" runat="server">
                    </ext:HiddenField>
                    <ext:Label ID="Label2" Text="名额限制：" runat="server" Width="100px">
                    </ext:Label>
                    <ext:TextBox ID="txtHits" runat="server" Width="60px" Label="名额限制" Regex="^\d+$"
                        Text="0" Required="true">
                    </ext:TextBox>
                </Items>
            </ext:Panel>
            <ext:TextArea ID="txtKeywords" runat="server" EmptyText="请输入站点优化关键词" Label="关键词"
                Height="40px">
            </ext:TextArea>
            <ext:TextArea ID="txtDescription" runat="server" EmptyText="请输入站点优化描述" Label="描述"
                Height="40px">
            </ext:TextArea>
            <ext:CheckBox ID="cboxStatus" runat="server" Label="状态" Checked="true" Text="显示/隐藏"
                Hidden="true">
            </ext:CheckBox>
            <ext:Panel ID="Panel2" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer">
                <Items>
                    <ext:HiddenField ID="HiddenField4" runat="server">
                    </ext:HiddenField>
                    <ext:Label ID="Label3" Text="&nbsp;&nbsp;排序：" runat="server" Width="100px">
                    </ext:Label>
                    <ext:TextBox ID="txtOrder" runat="server" Width="60px" Label="排序" Regex="^\d+$" Text="999"
                        Required="true">
                    </ext:TextBox>
                    <ext:Label ID="Label4" Text="&nbsp;&nbsp;作者：" runat="server">
                    </ext:Label>
                    <ext:TextBox ID="txtAuthor" runat="server" Width="100px" Label="作者" Text="佚名" Required="true">
                    </ext:TextBox>
                    <ext:Label ID="Label5" Text="&nbsp;&nbsp;来源：" runat="server">
                    </ext:Label>
                    <ext:TextBox ID="txtFrom" runat="server" Width="100px" Label="来源" Text="本站" Required="true">
                    </ext:TextBox>
                    <ext:Label ID="Label10" Text="报名截止日期：" runat="server">
                    </ext:Label>
                    <ext:DatePicker ID="dpEndDate" runat="server" Label="报名截止日期" Required="true" DateFormatString="yyyy-MM-dd">
                    </ext:DatePicker>
                </Items>
            </ext:Panel>
            <ext:FileUpload ID="fuProdImages" runat="server" ButtonText="选择图片" EmptyText="图片新闻请上传图片,图片规格：410*234px"
                Label="新闻略图图片" Width="420" Hidden="true">
            </ext:FileUpload>
            <ext:Panel ID="Panel3" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                CssClass="x-form-item datecontainer">
                <Items>
                    <ext:Label ID="Label6" Width="100px" runat="server" Text="更新正文：">
                    </ext:Label>
                    <ext:Button ID="btnLoadData" runat="server" Text="加载数据" OnClick="btnLoadData_Click">
                    </ext:Button>
                    <ext:Label ID="Label7" runat="server" Text="（若不更新数据，则无需重新加载数据！)">
                    </ext:Label>
                </Items>
            </ext:Panel>
            <ext:ContentPanel ID="ContentPanel1" runat="server" AutoWidth="true" ShowBorder="false"
                ShowHeader="false">
                <table cellpadding="0" cellspacing="0" style="width: 100%;">
                    <tr>
                        <td valign="top" style="width: 100px;">
                            文章正文：
                        </td>
                        <td style="padding-right: 22px;">
                            <textarea name="UEditor1" id="UEditor1"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <ext:Button ID="btnGetShortInfo" runat="server" Text="获取文章摘要" ValidateForms="sfObject"
                                OnClick="btnGetShortInfo_Click">
                            </ext:Button>
                        </td>
                    </tr>
                </table>
            </ext:ContentPanel>
            <ext:ContentPanel ID="ContentPanel2" runat="server" AutoWidth="true" ShowBorder="false"
                ShowHeader="false">
                <table cellpadding="0" cellspacing="0" style="width: 100%;">
                    <tr>
                        <td valign="top" style="width: 100px;">
                            文章摘要：
                        </td>
                        <td style="padding-right: 22px;">
                            <textarea name="UEditor2" id="UEditor2"></textarea>
                        </td>
                    </tr>
                </table>
            </ext:ContentPanel>
        </Items>
        <Toolbars>
            <ext:Toolbar ID="Toolbar2" runat="server" Position="footer">
                <Items>
                    <ext:Button ID="btnSubmit" runat="server" Text="保存" Icon="systemsave" OnClick="btnSubmit_Click"
                        ValidateForms="sfObject">
                    </ext:Button>
                    <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                    </ext:ToolbarSeparator>
                    <ext:Button ID="btnReset" runat="server" Text="重置" Icon="reload">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
    </ext:SimpleForm>
    </form>

    <script type="text/javascript">
        window.UEDITOR_HOME_URL = "<%= ResolveUrl("~/ueditor/") %>";
    </script>

    <script type="text/javascript" src="../ueditor/editor_config.js"></script>

    <script type="text/javascript" src="../ueditor/editor_all.js"></script>

    <script type="text/javascript">
        var editor1,editor2;
        function onReady() {
            editor1 = new UE.ui.Editor({
                initialFrameWidth: '100%',
                initialFrameHeight: 350,
                minFrameHeight: 350,
                autoFloatEnabled: false,
                focus: true
            });
            editor1.render("UEditor1");
            
            editor2 = new UE.ui.Editor({
                initialFrameWidth: '100%',
                initialFrameHeight: 80,
                minFrameHeight: 80,
                autoFloatEnabled: false,
                initialContent: '',
                toolbars: [
                ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',
                    'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain']]
            });
            editor2.render("UEditor2");

        }


        // 提交数据之前同步到表单隐藏字段
        X.util.beforeAjaxPostBackScript = function () {
            editor1.sync();
            editor2.sync();
        };


        // 更新编辑器内容
        function updateUEditor1(content) {
            window.setTimeout(function () {
                editor1.setContent(content);
            }, 100);
        }

        function updateUEditor2(content) {
            window.setTimeout(function () {
                editor2.setContent(content);
            }, 100);
        }    
    </script>

</body>
</html>
